﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BouquetApplication.logging
{
    public class LoggerFactory
    {
        private const string FileLogger = "File";
        private const string ConsoleLogger = "Console";

        public static ILogger CreateLogger()
        {
            Configuration conf = new Configuration();
            List<string> loggers = conf.GetLoggers();
            LoggerContainer container = new LoggerContainer();
            foreach (string type in loggers)
            {
                ILogger logger = GetLogger(type);
                container.Add(logger);
            }

            return container;
        }

        private static ILogger GetLogger(string type)
        {
            ILogger logger = null;
            if (type == FileLogger)
            {
                logger = new FileLogger();

            }
            else if (type == ConsoleLogger)
            {
                logger = new ConsoleLogger();
            }

            return logger;
        }
    }

}
